package cn.yiufung.qxquartz.common;

/**
 * @author 姚锋
 * @createTime 2023年08月18日 16:13:00
 */
public enum StatusCode {

    /**
     * 成功
     */
    SUCCESS(200, "Success"),

    /**
     * 资源已创建
     */
    CREATED(201, "Resource created"),

    /**
     * 错误请求
     */
    BAD_REQUEST(400, "Bad request"),

    /**
     * 未认证
     */
    UNAUTHORIZED(401, "Unauthorized"),

    /**
     * 禁止访问
     */
    FORBIDDEN(403, "Forbidden"),

    /**
     * 找不到资源
     */
    NOT_FOUND(404, "Resource not found"),

    /**
     * 内部服务错误
     */
    INTERNAL_SERVER_ERROR(500, "Internal server error");

    private final int code;
    private final String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
